<div ng-controller="applyCtrl">


  <div class="col-lg-12 col-sm-12 col-xs-12">
        <div class="widget">
           <!-- <div class="widget-header bordered-bottom bordered-themeprimary">
                <i class="widget-icon fa fa-tasks themeprimary"></i>
                <span class="widget-caption themeprimary">申请记录</span>
            </div> -->
            <div class="widget-body no-padding">
                <div class="task-container">
                  <!-- <div class="task-search" style="display:flex;justify-content: space-between;">
                      <div class="task-check" style="display:inline-block;line-height:32px;">
                          <label>
                              <input type="checkbox" ng-model='selectall'>
                              <span class="text">全选</span>
                          </label>
                      </div>
                      <div  style="display:inline-block;line-height:32px;">
                        <span ng-click="delNews()" style="cursor:pointer;">删除申请记录</span>
                      </div>
                  </div> -->
                    <ul class="tasks-list">
                        <li class="task-item" ng-repeat="x in news" ng-if="!x.dealStatus">
                            <div class="task-check">
                                <label>
                                    <input type="checkbox" ng-value='x.id' ng-checked='selectall' />
                                    <span class="text"></span>
                                </label>
                                <!-- <span ng-click="dealApply(x.id,true)" class="apply-btn apply-btn-agree">同意</span>
                                <span ng-click="dealApply(x.id,false)" class="apply-btn apply-btn-reject">拒绝</span> -->
                            </div>
                            <div class="task-state" ng-if="x.type==3">
                                <span class="label label-yellow">
                                    出差申请单
                                </span>
                            </div>
                            <div class="task-state" ng-if="x.type==1">
                                <span class="label label-orange">
                                    请假申请单
                                </span>
                            </div>
                            <div class="task-state" ng-if="x.type==2">
                                <span class="label label-palegreen">
                                    加班申请单
                                </span>
                            </div>
                            <div class="task-time">发送时间：{{x.sendDate}}</div>
                            <div class="task-body">{{x.info}}</div>
                            <div class="task-creator"><a>申请人：{{x.name}}</a></div>
                            <div class="task-assignedto" ng-click="showDetail(x)"><a>点击查看详情</a></div>
                        </li>
                    </ul>
                </div>
            </div><!--Widget Body-->
        </div>

    </div>



    <div class="col-lg-6 col-sm-6 col-xs-11 modal update-model" ng-class="showModal2?'show':'noshow'">
  		<div class="modal-content">
  			<div class="modal-header">
  				<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="toggleshowModal2()">×</button>
  				<h4 class="modal-title">申请详情</h4>
  			</div>
  			<div class="modal-body">
  				<h5>申请人：{{event.name}}</h5>
  				<h6>申请类型：{{event.type | applyType}}</h6>
  				<h6>申请时间段： {{event.dateRange}}</h6>
  				<h6 ng-if="event.type==3">出差地点： {{event.outAddress}}</h6>
  				<p>申请内容：{{event.info}}</p>
  			</div>
  			<div class="modal-footer">
  				<button class="btn btn-danger " type="button" id="apply-reject" ng-if="!event.dealStatus" ng-click="makesure(false)">驳回</button>
                <button class="btn btn-primary " type="button" id="apply-agree" ng-if="!event.dealStatus" ng-click="makesure(true)">同意</button>

                <button class="btn" type="button"   ng-if="event.dealStatus" ng-click="toggleshowModal2()">{{event.dealresult | applyStatus}}</button>
  			</div>
  		</div>
  	</div>

  	<div class="mask" ng-class="showModal2?'show':'noshow'"></div>

</div>
